package com.entrogy.utils;

import java.util.Calendar;
import java.util.Date;

/**
 * @author xlr
 * @date 2019-7
 * @description 判断日期是否是本周
 */
public class IsThisWeekUtil {
    // 判断选择的日期是否是本周
    public static boolean isThisWeek(long time) {
        Calendar calendar = Calendar.getInstance();
        int currentWeek = calendar.get(Calendar.WEEK_OF_YEAR);
        calendar.setTime(new Date(time));
        int paramWeek = calendar.get(Calendar.WEEK_OF_YEAR);
        if (paramWeek == currentWeek) {
            return true;
        }
        return false;
    }
}
